package com.ruoyi.system.service.impl;
import com.ruoyi.system.domain.vo.InspectionPeriodVO;
import com.ruoyi.system.entity.InspectionPeriod;
import com.ruoyi.system.mapper.InspectionPeriodMapper;
import com.ruoyi.system.service.InspectionPeriodService;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.List;

/**
 * <p>
 * 巡检周期时间段维护表 服务实现类
 * </p>
 *
 * @author liushuai 
 * @since 2023-03-07
 */
@Service("inspectionPeriodService")
public class InspectionPeriodServiceImpl implements InspectionPeriodService {


    @Resource
    private InspectionPeriodMapper inspectionPeriodMapper;

    @Override
    public List<InspectionPeriod> queryByPage(InspectionPeriod inspectionPeriod) {
        return inspectionPeriodMapper.queryAllByLimit(inspectionPeriod);
    }

    @Override
    public InspectionPeriod queryById(Integer id) {
        return this.inspectionPeriodMapper.queryById(id);
    }

    @Override
    public InspectionPeriod insert(InspectionPeriod inspectionPeriod) {
        this.inspectionPeriodMapper.insert(inspectionPeriod);
        return inspectionPeriod;
    }

    @Override
    public InspectionPeriod update(InspectionPeriod inspectionPeriod) {
        this.inspectionPeriodMapper.update(inspectionPeriod);
        return this.queryById(inspectionPeriod.getId());
    }

    @Override
    public boolean deleteById(Integer id) {
        return this.inspectionPeriodMapper.deleteById(id) > 0;
    }

    @Override
    public List<InspectionPeriodVO> queryListById(Integer id) {
        return inspectionPeriodMapper.queryListById(id);
    }


}
